package waal.pc.backend.channels;

import waal.pc.backend.module.Module;

public class DigitalOutputChannel extends DigitalChannel {

	public DigitalOutputChannel(Module module, int number, String name) {
		super(module, number, name, false);

	}
	
	public void sendOutput(boolean value) {
		if(value) {
			this.module.SendConfig(this.channelNumber, 0xFD, 1);
		} else {
			this.module.SendConfig(this.channelNumber, 0xFD, 0);
		}
	}
	
	public void toggleChannel() {
		this.sendOutput(!this.getLastState());
	}

}
